<?php

namespace App\Mail;

use App\Models\Company;
use Illuminate\Bus\Queueable;
use App\Models\Admin;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class PassWord extends Mailable
{
    use Queueable, SerializesModels;
    protected $_admin;

    /**
     * Create a new message instance.
     *
     * @param $_userInfo
     */
    public function __construct($_userInfo)
    {
        $this->_admin = $_userInfo;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->view('emails.notice')
            ->subject('易微链账号开通通知')
            ->with([
                'name' => array_get($this->_admin, 'email'),
                'password' => array_get($this->_admin, 'password'),
                'alias' => array_get($this->_admin, 'alias'),
            ]);
    }
}
